#include "power_meter.h"

power_meter_struct power_meter_data = {};

void power_meter_callback(CAN_RxHeaderTypeDef* rx_header, uint8_t* data)
{
	power_meter_data.voltage = (float)(data[1] << 8 | data[0]) / 100;
	power_meter_data.current = (float)(data[3] << 8 | data[2]) / 100;
	power_meter_data.power = power_meter_data.voltage * power_meter_data.current;
	
}